using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectEuler1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(
                (from s in Enumerable.Range(1, 999) where (new int[] { 3, 5 }).Any(x => s % x == 0) select s).Sum()
            );
        }
    }
}

